package com.student.model;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.google.gson.annotations.Expose;

/**
 * AttendanceType entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "Attendance_Type", schema = "dbo", catalog = "StudentManager")
public class AttendanceType implements java.io.Serializable {

	// Fields
	@Expose
	private Long attendanceTypeId;
	@Expose
	private String attendanceTypeName;
	private Set<AttendanceRecord> attendanceRecords = new HashSet<AttendanceRecord>(
			0);

	// Constructors

	/** default constructor */
	public AttendanceType() {
	}

	/** minimal constructor */
	public AttendanceType(Long attendanceTypeId, String attendanceTypeName) {
		this.attendanceTypeId = attendanceTypeId;
		this.attendanceTypeName = attendanceTypeName;
	}

	/** full constructor */
	public AttendanceType(Long attendanceTypeId, String attendanceTypeName,
			Set<AttendanceRecord> attendanceRecords) {
		this.attendanceTypeId = attendanceTypeId;
		this.attendanceTypeName = attendanceTypeName;
		this.attendanceRecords = attendanceRecords;
	}

	// Property accessors
	@Id
	@Column(name = "Attendance_Type_id", unique = true, nullable = false, precision = 18, scale = 0)
	@GeneratedValue
	public Long getAttendanceTypeId() {
		return this.attendanceTypeId;
	}

	public void setAttendanceTypeId(Long attendanceTypeId) {
		this.attendanceTypeId = attendanceTypeId;
	}

	@Column(name = "Attendance_Type_Name", nullable = false, length = 20)
	public String getAttendanceTypeName() {
		return this.attendanceTypeName;
	}

	public void setAttendanceTypeName(String attendanceTypeName) {
		this.attendanceTypeName = attendanceTypeName;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "attendanceType")
	public Set<AttendanceRecord> getAttendanceRecords() {
		return this.attendanceRecords;
	}

	public void setAttendanceRecords(Set<AttendanceRecord> attendanceRecords) {
		this.attendanceRecords = attendanceRecords;
	}

}